package com.itheima.springboottilasmanager.config;

import com.itheima.springboottilasmanager.InterCeper.LoginInterCeper;
import com.itheima.springboottilasmanager.InterCeper.test1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class Webconfig implements WebMvcConfigurer {
//    注册拦截器刀spring框架

@Autowired
LoginInterCeper ict;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(interceptor).addPathPatterns("/**");
registry.addInterceptor(ict).addPathPatterns("/**").excludePathPatterns("/login");
    }
}
